<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<title><?php echo ($name); ?></title>
<script src="__APP__/statics/jquery-1.9.1.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="__APP__/statics/css/jNotify.jquery.css" />
<script type="text/javascript" src="__APP__/statics/jNotify.jquery.js"></script>
<style>
 body{font-family:"微软雅黑";font-size:12px;color:#666666;background-color:#F9F9F6}
 *{margin: 0;} 
 a{text-decoration:none}
 img{border:0px}
.cat{background-color:#F9F9F6;margin-left:10px;z-index:0;}
.cat_list:hover{background-color:#fff;}
.title{background:url("__APP__/statics/tbg.gif");font-weight:bold}

#save{text-align:center;border:0;width:100%;height:40px;background-color:#fff;position:fixed;left:0px;bottom:0px;z-index:999;border:1px solid #DFDFDF;background-color:#DFDFDF;padding:5px;height:20px}
</style>

<style>
input{padding:5px}
</style>


<form method="POST" action="__URL__/updateShop" enctype="multipart/form-data">
<table border="0" width="100%" cellspacing="3" cellpadding="3">
	<tr>
		<td bgcolor="#C3DAF9" width="137" align="right">商家名称：</td>
		<td><input type="text" name="name" size="20" value="<?php echo ($shop["shop_name"]); ?>">（必填）</td>
	</tr>
	<tr>
		<td bgcolor="#C3DAF9" width="137">
		<p align="right">特色域名：</td>
		<td><input type="text" name="domain" value="<?php echo ($shop["domain"]); ?>"><div id="tixing"></div></td>
	</tr>
	<tr>
		<td bgcolor="#C3DAF9" width="137" align="right">等级：</td>
		<td>
			<select size="1" name="level">
				<option value="1" <?php if($shop["level"] == 1): ?>selected<?php endif; ?>>★</option>
				<option value="2" <?php if($shop["level"] == 2): ?>selected<?php endif; ?>>★★</option>
				<option value="3" <?php if($shop["level"] == 3): ?>selected<?php endif; ?>>★★★</option>
				<option value="4" <?php if($shop["level"] == 4): ?>selected<?php endif; ?>>★★★★</option>
				<option value="5" <?php if($shop["level"] == 5): ?>selected<?php endif; ?>>★★★★★</option>
			</select>
		</td>
	</tr>
	<tr>
		<td bgcolor="#C3DAF9" width="137" align="right">简介：</td>
		<td><textarea rows="7" name="intro" cols="63"><?php echo ($shop["shop_intro"]); ?></textarea></td>
	</tr>
	<tr>
		<td bgcolor="#C3DAF9" width="137" align="right">蚂蚁点评：</td>
		<td><textarea rows="7" name="review" cols="63"><?php echo ($shop["review"]); ?></textarea></td>
	</tr>
	<tr>
		<td bgcolor="#C3DAF9" width="137" align="right">联系人：</td>
		<td><input type="text" name="user" size="20" value="<?php echo ($shop["shop_user"]); ?>"></td>
	</tr>
	<tr>
		<td bgcolor="#C3DAF9" width="137" align="right">地址：</td>
		<td><input type="text" name="address" size="20" value="<?php echo ($shop["shop_address"]); ?>"></td>
	</tr>
	<tr>
		<td bgcolor="#C3DAF9" width="137" align="right">电话：</td>
		<td><input type="text" name="tel" size="20" value="<?php echo ($shop["shop_tel"]); ?>"></td>
	</tr>
	<tr>
		<td bgcolor="#C3DAF9" width="137" align="right">有效期至：</td>
		<td><input type="text" name="end_time" size="20" <?php if($shop["end_time"] > 0): ?>value='<?php echo (date("Y-m-d",$shop["end_time"])); ?>'><?php endif; ?></td>
	</tr>
	<tr>
		<td bgcolor="#C3DAF9" width="137" align="right">店铺logo：</td>
		<td><input type="file" name="logo" size="20">
		<?php if($shop["shop_logo"] != ''): ?><a href="__APP__/weishop/logo/<?php echo ($shop["shop_logo"]); ?>" target="_blank"><img src="__APP__/weishop/logo/<?php echo ($shop["shop_logo"]); ?>" height=80></a><?php endif; ?>
		</td>
	</tr>
	<tr>
		<td bgcolor="#C3DAF9" width="137" align="right">店铺banner：</td>
		<td><input type="file" name="banner" size="20">
		<?php if($shop["shop_banner"] != ''): ?><a href="__APP__/weishop/logo/<?php echo ($shop["shop_banner"]); ?>" target="_blank"><img src="__APP__/weishop/logo/<?php echo ($shop["shop_banner"]); ?>" height=80></a><?php endif; ?>
		</td>
	</tr>
</table>
<input type="text" name="shop_id" value="<?php echo ($shop["shop_id"]); ?>" style="display:none">
<br><br><br>
<div id="save"><input id="change" type="submit" value="保存更改"></div>
</form>

<script>
$(function(){
    $("[name=domain]").blur(function(){
	    var domain=$("[name=domain]").val();
		var shop_id = $("[name=shop_id]").val();
		if(domain != ''){
				$.get("__URL__/checkDomain",{domain:domain,shop_id:shop_id},function(res){
					var res = eval('(' +res+ ')');
					if(res.errno == 0){
						$("#tixing").html("<font color='green'>可以使用</font>");
					}else{
						$("[name=domain]").val('');
						$("#tixing").html("<font color='red'>已被占用</font>");
					}
				})
		}
	})

})
</script>
</body>
</html>